package com.freewater.cargotracker.infrastructure.persistence.mybatis.mapper;

import com.freewater.cargotracker.infrastructure.persistence.mybatis.dbobject.LegPO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;
import java.util.Set;

@Mapper
public interface LegMapper {

    int insertAll(List<LegPO> legPOs);

    int updateByIdSelective(@Param("legPo") LegPO legPO,
                            @Param("changedFields") Set<String> changedFields);

    List<LegPO> findByCargoId(Long cargoId);

    int deleteById(Long id);

    int deleteByCargoId(Long cargoId);

    int deleteAll();
}
